/**
  ******************************************************************************
  * @file    data_check.h
  * @author  ashuai0110
  * @version V2.3
  * @date    2024-07-01
  * @brief   数据校验方法集合
  *
  ******************************************************************************
  * @attention
  *
  * 版权声明:内容为编者(ashuai0110)原创,使用请注明出处,当然,你也可以不这样做^_^
  * 出处链接:https://gitee.com/ashuai0110/mcu_reuse_development_module.git
  *
  ******************************************************************************
  */

#ifndef __DATA_CHECK_H
#define __DATA_CHECK_H

#ifdef __cplusplus
extern "C" {
#endif

/* 包含头文件-----------------------------------------------------------------*/
#include "common_include.h"

/**
 * @addtogroup modules
 * @{
 */

/**
 * @addtogroup data_check
 * @{
 */

/* 宏定义---------------------------------------------------------------------*/

/* 类型定义-------------------------------------------------------------------*/

/* 全局变量-------------------------------------------------------------------*/

/* 函数原型-------------------------------------------------------------------*/
/**
 * @addtogroup data_check_global_functions
 * @{
 */

uint8_t check_sum(uint8_t *data, uint16_t len);
uint8_t check_xor(uint8_t *data, uint16_t len);
uint8_t check_lrc(uint8_t *pBuf, uint16_t len);
uint8_t check_crc4_itu(uint8_t *data, uint16_t len);
uint8_t check_crc5_epc(uint8_t *data, uint16_t len);
uint8_t check_crc5_itu(uint8_t *data, uint16_t len);
uint8_t check_crc5_usb(uint8_t *data, uint16_t len);
uint8_t check_crc6_itu(uint8_t *data, uint16_t len);
uint8_t check_crc7_mmc(uint8_t *data, uint16_t len);
uint8_t check_crc8(uint8_t *data, uint16_t len);
uint8_t check_crc8_itu(uint8_t *data, uint16_t len);
uint8_t check_crc8_rohc(uint8_t *data, uint16_t len);
uint8_t check_crc8_maxim(uint8_t *data, uint16_t len);
uint16_t check_crc16_ibm(uint8_t *data, uint16_t len);
uint16_t check_crc16_maxim(uint8_t *data, uint16_t len);
uint16_t check_crc16_usb(uint8_t *data, uint16_t len);
uint16_t check_crc16_modbus(uint8_t *data, uint16_t len);
uint16_t check_crc16_ccitt(uint8_t *data, uint16_t len);
uint16_t check_crc16_ccitt_false(uint8_t *data, uint16_t len);
uint16_t check_crc16_x25(uint8_t *data, uint16_t len);
uint16_t check_crc16_xmodem(uint8_t *data, uint16_t len);
uint16_t check_crc16_dnp(uint8_t *data, uint16_t len);
uint32_t check_crc32(uint8_t *data, uint16_t len);
uint32_t check_crc32_mpeg_2(uint8_t *data, uint16_t len);

/**
 * @}
 */

/**
 * @}
 */

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif /* data_check.h */
